package com.eqdd.yiqidian.ui.companyspace

import com.eqdd.yiqidian.bean.CoreValueBean
import com.eqdd.yiqidian.bean.rebuild.slimedit.SlimEditEnterBean
import com.eqdd.yiqidian.bean.rebuild.slimedit.SlimImageSelectBean
import com.eqdd.yiqidian.http.HttpConfig
import com.eqdd.yiqidian.ui.companyspace.base.BaseSpaceInfoActivity
import com.lzy.okgo.model.HttpParams

/**
 * Created by jhj on 18-6-26.
 */
class CoreValueInfoActivity : BaseSpaceInfoActivity<CoreValueBean>() {


    override val topbar: String
        get() = "核心价值观"

    override val deleteUrl: String
        get() = HttpConfig.BASE_URL + HttpConfig.CORE_VALUE_DELETE

    override val updateImgUrl: String
        get() = HttpConfig.BASE_URL + HttpConfig.CORE_VALUE_IMAGE_UPDATE

    override val updateOtherUrl: String
        get() = HttpConfig.BASE_URL + HttpConfig.CORE_VALUE_UPDATE

    override val updateIdFieldName: String
        get() = "coreValuesId"
    override val deleteIdFieldName: String
        get() = "coreValuesId"

    override fun updateOtherParams(): HttpParams {
        val data = slimAdapterEx.data
        updateOtherParams.put("title", data[1].content)
        updateOtherParams.put("Describe", data[2].content)
        return updateOtherParams
    }

    override fun setEditBeans() {
        datas.add(SlimImageSelectBean("图      片", 0, bean?.imageUrl).setDeal(true).setNeed(true))
        datas.add(SlimEditEnterBean("图片标题", bean?.title, 1, "请输入").setNeed(true))
        datas.add(SlimEditEnterBean("图片描述", bean?.describe, 2, "请输入").setNeed(true))
    }
}